package com.niiwoo.civet.scheduler.trigger;

import com.alibaba.dubbo.config.annotation.Reference;
import com.niiwoo.civet.account.service.trade.TransOrderDubboService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 账户中心 交易冻结/解冻相关JOB
 * Created by wangjichao on 2018/4/27.
 */
@Component
@Slf4j
public class TransOrderJobTrigger {

    @Reference(version = "1.0.0")
    private TransOrderDubboService transOrderDubboService;

    @Scheduled(cron = "${transorder.trans-freeze-result-check}")
    public void transFreezeResultCheckJob(){
        log.info("transFreezeResultCheckJob begin");
        transOrderDubboService.transFreezeResultCheckJob();
        log.info("transFreezeResultCheckJob end");
    }

    @Scheduled(cron = "${transorder.trans-unfreeze-result-check}")
    public void transUnfreezeResultCheckJob(){
        log.info("transUnfreezeResultCheckJob begin");
        transOrderDubboService.transUnfreezeResultCheckJob();
        log.info("transUnfreezeResultCheckJob end");
    }
}
